package com.gjzt.business.bid.controller;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eastdigit.servlet.RequestAttribute;
import com.eastdigit.servlet.Response;
import com.eastdigit.servlet.ReqBean;
import com.gjzt.business.bid.service.BiddingDepositService;

@Controller
@RequestMapping(value = "/biddingDeposit")
public class BiddingDepositController {

    @Autowired
    private BiddingDepositService biddingDepositService;

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/query")
    @ResponseBody
    public JSONObject queryBiddingDeposit(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(biddingDepositService.findBiddingDeposit(reqBean));
    }

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/getCustomerDeposit")
    @ResponseBody
    public JSONObject getCustomerDeposit(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(biddingDepositService.getCustomerDeposit(reqBean));
    }
    
    /**
     * 添加
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public JSONObject addBiddingDeposit(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        biddingDepositService.addBiddingDeposit(reqBean);
        return Response.responseSuccess();
    }

    /**
     * 修改
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public JSONObject updateBiddingDeposit(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        biddingDepositService.updateBiddingDeposit(reqBean);
        return Response.responseSuccess();
    }

    /**
     * 删除
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public JSONObject removeBiddingDeposit(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        biddingDepositService.removeBiddingDeposit(reqBean);
        return Response.responseSuccess();
    }

    
    @RequestMapping(value = "/queryCustomerList")
    @ResponseBody
    public JSONObject queryCustomerList(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(biddingDepositService.queryCustomerList());
    }
    
    @RequestMapping(value = "/queryBidList")
    @ResponseBody
    public JSONObject queryBidList(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(biddingDepositService.queryBidList());
    }
    //TODO 其他功能
}